﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;

namespace TKT.Lifter.CIM.Lifter.TibcoMsg.Lifter
{
    public class PortStateChangeReply : MessageBody
    {
        public string MachineName { get; set; }
        public string PortID { get; set; }
        public string PortInOutType { get; set; }

        public PortStateChangeReply()
            : base("PortStateChangedReply")
        { }

        public override System.Xml.Linq.XElement ToXElement()
        {
            XElement body = new XElement("Body");
            body.Add(new XElement("MACHINENAME", this.MachineName));
            body.Add(new XElement("PORTID", this.PortID));
            body.Add(new XElement("PORTINOUTTYPE", this.PortInOutType));
            return body;
        }

        public override void Parse(System.Xml.Linq.XElement body)
        {
            this.MachineName = body.Element("MACHINENAME").Value;
            this.PortID = body.Element("PORTID").Value;
            this.PortInOutType = body.Element("PORTINOUTTYPE").Value;
        }
    }
}
